package com.cslc.wechat.common.mp;


/**
 * 公众平台的接口调用URL和请求方式的枚举常量，
 * url中需要需要填写的参数以%s代替。
 * @author keliangliang
 *
 */
public enum MpApi {
	//GET请求获取access_token
	GET_TOKEN("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s","GET"),
	//POST请求创建自定义菜单
	CREATE_MENU("https://api.weixin.qq.com/cgi-bin/menu/create?access_token=%s", "POST"),
	//GET请求查询自定义菜单结构
	GET_MENU("https://api.weixin.qq.com/cgi-bin/menu/get?access_token=%s", "GET"),
	//GET请求删除当前使用的自定义菜单
	DELETE_MENU("https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=%s","GET"),
	
	//GET请求获取素材总数
	GET_MATERIAL_COUNT("https://api.weixin.qq.com/cgi-bin/material/get_materialcount?access_token=%s","GET"),
	
	//GET请求获取用户基本信息
	GET_USER_INFO("https://api.weixin.qq.com/cgi-bin/user/info?access_token=%s&openid=%s&lang=zh_CN","GET"),
	
	//GET请求通过code获取网页授权access_token，与openid
	GET_OAUTH2_TOKEN("https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code", "GET"),
	
	//POST请求通过客服接口48小时内无限制发送消息
	SEND_CUSTOM_MESSAGE("https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=%s", "POST"),
	
	//POST请求获取所有客服账号
	GET_KF_LIST("https://api.weixin.qq.com/cgi-bin/customservice/getkflist?access_token=%s", "GET"),
	
	//POST请求创建二维码ticket
	CREATE_QRCODE("https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=%s", "POST"),
	
	//GET请求通过ticket换取二维码
	SHOW_CODE_WITH_TICKET("https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=%s", "GET"),
	
	//GET请求获取jsapi_ticket
	GET_JSAPI_TICKET("https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=%s&type=jsapi", "GET"),
	
	GET_TEMP_MATERIAL("https://api.weixin.qq.com/cgi-bin/media/get?access_token=%s&media_id=%s", "GET");
	
	String url;
	String method;
	MpApi(String url, String method) {
		this.url = url;
		this.method = method;
	}
	public String getUrl() {
		return url;
	}
	public String getMethod() {
		return method;
	}
}
